<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta name="xbsj-labels" content="Earth示例">
  </meta>
  <title>百度地图</title>
  <!-- 0 引入js文件 -->
  <script src="../../XbsjEarth/XbsjEarth.js"></script>
  <style>
    html,
    body {
      width: 100%;
      height: 100%;
      margin: 0px;
      padding: 0px;
    }
  </style>
</head>

<body>
  <div id="earthContainer" style="width: 100%; height: 100%; background: grey">
  </div>
  <script>
    var earth;

    function startup() {
      earth = new XE.Earth('earthContainer');

      earth.sceneTree.root = {
    "title": "当前场景",
    "isSelected": true,
    "children": [
        {
            "czmObject": {
                "xbsjType": "Terrain",
                "xbsjGuid": "4edae0f1-89c7-46e5-8ad3-566d5a234312",
                "name": "中国14级（测试）",
                "xbsjTerrainProvider": {
                    "type": "XbsjCesiumTerrainProvider",
                    "XbsjEllipsoidTerrainProvider": {},
                    "XbsjCesiumTerrainProvider": {
                        "url": "//lab.earthsdk.com/terrain/577fd5b0ac1f11e99dbd8fd044883638",
                        "requestVertexNormals": true,
                        "requestWaterMask": true
                    }
                }
            }
        },
        {
            "czmObject": {
                "xbsjType": "Imagery",
                "xbsjGuid": "99884d2b-262c-4d34-a669-75c5e8613975",
                "name": "百度地图",
                "rectangle": null,
                "xbsjImageryProvider": {
                    "XbsjImageryProvider": {
                        "url": "//online1.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles=pl&scaler=1&p=1",
                        "srcCoordType": "BD09",
                        "rectangle": null
                    },
                    "UrlTemplateImageryProvider": {
                        "rectangle": null
                    },
                    "WebMapTileServiceImageryProvider": {
                        "rectangle": null
                    }
                }
            }
        }
    ]
}
    }

    // 1 XE.ready()会加载Cesium.js等其他资源，注意ready()返回一个Promise对象。
    XE.ready().then(startup);
  </script>
</body>

</html>